package com.zb.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zb.entity.ZjWorkDispatchEngineer;
import com.zb.extend.NetworkEmpDispatchOrderListExtend;
import com.zb.mobile.NetworkMobileOrderListSelectVo;
import com.zb.mobile.NetworkMobileOrderMessageListSelectVo;
import com.zb.mobile.NetworkOrderStatusQtyVo;

import java.util.Collection;
import java.util.List;

/**
 * <p>
 * 工单分派工程师表 服务类
 * </p>
 *
 * @author WEN
 * @since 2023-10-23
 */
public interface ZjWorkDispatchEngineerService extends IService<ZjWorkDispatchEngineer> {

    /**
     * 保存工程师确认接单
     * @param id 分派工单师表ID
     */
    void saveEngineerSureReceiveOrder(Long id);

    /**
     * 保存工程师拒绝接单
     * @param id 分派工单师表ID
     * @param remark 备注
     */
    void saveEngineerRefuseReceiveOrder(Long id, String remark);

    /**
     * 根据服务人员ID获取未确认接单数量
     * @param networkEmpId 服务人员ID
     * @return
     */
    long getWaitReceivingOrderQty(Long networkEmpId);

    /**
     * 根据服务人员ID获取未签到的工单数量
     * @param custAccId 商家ID
     * @param networkId 服务商ID
     * @param networkEmpId 服务人员ID
     * @return
     */
    long getWaitSignInOrderQty(Long custAccId, Long networkId, Long networkEmpId);

    /**
     * 分页获取服务人员工单
     * @param networkId 服务商ID
     * @param networkEmpId 服务商人员ID
     * @param selectVo 搜索条件
     * @return
     */
    List<Long> getWorkIdByNetworkIdAndNetworkEmpId(Long networkId, Long networkEmpId, NetworkMobileOrderMessageListSelectVo selectVo);

    /**
     * 根据服务商人员ID & 工单ID获取派工信息
     * @param networkId 服务商ID
     * @param networkEmpId 服务商人员ID
     * @param workIds 工单ID
     * @return
     */
    List<ZjWorkDispatchEngineer> getByNetworkEmpIdAndWorkIds(Long networkId, Long networkEmpId, List<Long> workIds);

    /**
     * 根据工单ID&服务商ID&服务商人员ID获取派工信息
     * @param workId 工单ID
     * @param networkId 服务商ID
     * @param networkEmpId 服务商人员ID
     * @return
     */
    ZjWorkDispatchEngineer getByWorkIdAndNetworkIdAndNetworkEmpId(Long workId, Long networkId, Long networkEmpId);

    /**
     * 获取服务商工单列表状态数量
     * @param networkId 服务商ID
     * @param networkEmpId 服务人员ID
     * @param keyword 搜索关键词：工单单号/一物一码/产品名称/产品型号
     * @return
     */
    NetworkOrderStatusQtyVo getNetworkOrderListStatusQty(Long networkId, Long networkEmpId, String keyword);

    /**
     * 获取工程师工单列表
     * @param networkId 服务商ID
     * @param networkEmpId 服务人员ID
     * @param selectVo 搜索条件
     * @return
     */
    List<NetworkEmpDispatchOrderListExtend> getNetworkEmpOrderList(Long custAccId, Long networkId, Long networkEmpId, NetworkMobileOrderListSelectVo selectVo);

    /**
     * 获取工程师工单列表总记录数
     * @param networkId 服务商ID
     * @param networkEmpId 服务人员ID
     * @param selectVo 搜索条件
     * @return
     */
    long getNetworkOrderListCount(Long custAccId, Long networkId, Long networkEmpId, NetworkMobileOrderListSelectVo selectVo);


    /**
     * 根据工单ID获取工单分配工程师信息
     * @param workIds 工单ID
     * @return
     */
    List<ZjWorkDispatchEngineer> getByWorkIds(List<Long> workIds);

    /**
     * 根据服务人员ID&工单ID获取服务人员信息
     * @param networkEmpId 服务人员ID
     * @param workId 工单ID
     * @return
     */
    ZjWorkDispatchEngineer getByNetworkEmpIdAndWorkId(Long networkEmpId, Long workId);

}
